//**************************************************************************************
/** \file virdemo_classes.h
 *    This file contains some classes which don't do much of anything except for 
 *    causing virtual and non-virtual methods to be called.  The idea is to see how
 *    long, on average, it takes to get such methods to run.  
 *
 *  Revisions:
 *    \li 02-03-2008 JRR Original file
 *    \li 03-04-2008 JRR Added multiple inheritance tests
 *    \li 05-06-2008 JRR Changed to use new serial port classes
 *    \li 01-29-2009 JRR Changed again to use even newer serial port classes
 *    \li 04-21-2010 JRR Changed into new directory structure with /lib
 *    \li 04-19-2012 JRR Stripped out speed test stuff to make clearer demonstration
 *
 *  License:
 *    This file copyright 2007-2012 by JR Ridgely. It is released under the Lesser GNU
 *    public license, version 2.
 */
//**************************************************************************************

//--------------------------------------------------------------------------------------
/** This is an ordinary function which is called without using the C++ class structure
 *  at all. 
 */

void just_function (void);


//--------------------------------------------------------------------------------------
/** This class contains methods which are used in either virtual or non-virtual mode.
 *  The methods don't do anything except test how long such calls take to make. 
 */

class mom_class
{
	protected:
		base_text_serial* ser_port;			// Pointer to a serial port object

	public:
		mom_class (base_text_serial*);		// Default constructor just saves pointer

		void omethod (void);				// Ordinary non-virtual method
		virtual void vmethod (void);		// Method can be virtual for comparison
};


//--------------------------------------------------------------------------------------
/** This class is descended from one parent class; it has virtual and non-virtual 
 *  methods.
 */

class child_class : public mom_class
{
	protected:
	
	public:
		child_class (base_text_serial*);	// The constructor passes serial port

		void omethod (void);				// Ordinary method overrides ancestor's
		void vmethod (void);				// Virtual method: does it run more slowly?
};
